import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import lombok.Data;

/**
 * @author zhangqing
 * @version 1.0
 * @date 2022/6/27
 */
@Data
public class InjectionPackageConfig extends PackageConfig {

    private String dataService = "dao.dataService";
    private String dataServiceImpl = "dao.dataService.impl";

    private String req = "req";
    private String resp = "resp";
    private String parent = "personal.zq";

    public InjectionPackageConfig() {
        this.setEntity("dao.entity");
        this.setMapper("dao.mapper");
        this.setXml("dao.mapper.mapperImpl");
        this.setService("service");
        this.setServiceImpl("service.impl");
    }

    public InjectionPackageConfig setParent(String parent) {
        this.parent = parent;
        return this;
    }

    public String getParent() {
        return StringUtils.isNotBlank(this.getModuleName()) ? this.parent + "." + this.getModuleName() :
                this.getParent();
    }
}
